package com.example.fsd.controller.navmenu;

import com.example.fsd.common.result.R;
import com.example.fsd.pojo.NavMenu;
import com.example.fsd.service.navmenu.INavMenuService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangguihong
 * @since 2024-11-19
 */
@RestController
@RequestMapping("/navMenu")
@RequiredArgsConstructor
public class NavMenuController {
    private  final INavMenuService navMenuService;

    @GetMapping("/listNavMenu")
    private R listNavMenu(){
        return navMenuService.listNavMenu();
    }
    @PostMapping("/updateNavMenu")
    private R updateNavMenu(@RequestBody List<NavMenu> navMenus) {
        return navMenuService.updateNavMenu(navMenus);
    }
    @PostMapping("/addNavMenu")
    private R addNavMenu(@RequestBody NavMenu navMenu) {
        return navMenuService.addNavMenu(navMenu);
    }

}
